{template 'common/header'}
<ol class="breadcrumb" style="padding:5px 0;">
	<li><a href="{url 'home/welcome/ext'}"><i class="fa fa-cogs"></i> &nbsp; 扩展功能</a></li>
	<li><a href="{url 'home/welcome/ext' array('m' => $modulename)}">{$module_types[$module['type']]['title']}模块 - {$module['title']}</a></li>
	<li class="active">设置操作权限</li>
</ol>

<ul class="nav nav-tabs">
	<li class="active"><a>设置操作权限</a></li>
</ul>
<form action="" method="post">
<div class="panel panel-default">
<div class="panel-body table-responsive">
	<table class="table">
		<tr>
			<td width="100">用户名</td>
			<td>{$username}</td>
		</tr>
	</table>
</div>
</div>
	{if $shuju['cover']}
	<div class="panel panel-default">
		<div class="panel-heading">入口设置权限</div>
		<div class="panel-body table-responsivee">
			<table class="table">
				<thead>
				<tr>
					<th width="100">选择</th>
					<th width="400">导航标题</th>
					<th>链接地址</th>
				</tr>
				</thead>
				{loop $shuju['cover'] $index $cover}
				<tr>
					<input type="hidden" name="title[{$index}]" value="{$cover['title']}">
					<input type="hidden" name="do[{$index}]" value="{$cover['do']}">
					<input type="hidden" name="state[{$index}]" value="{$cover['state']}">
					<input type="hidden" name="eid[{$index}]" value="{$cover['eid']}">
					<td width="100"><input type="checkbox" name="enable[{$index}]" value="1" {if $cover['dostate'] == $usdata[$cover['do'] . $cover['state']]}checked{/if}></td>
					<td>{$cover['title']}</td>
					<td><a href="{$cover['url']}" target="_blank">{$cover['url']}</a></td>
				</tr>
				{/loop}
			</table>
		</div>
	</div>
	{/if}
	{if $shuju['menu']}
	<div class="panel panel-default">
		<div class="panel-heading">菜单操作权限</div>
		<div class="panel-body table-responsivee">
			<table class="table">
				<thead>
				<tr>
					<th width="100">选择</th>
					<th width="400">导航标题</th>
					<th>链接地址</th>
				</tr>
				</thead>
				{loop $shuju['menu'] $index $menu}
				<tr>
					<input type="hidden" name="title[{$index}]" value="{$menu['title']}">
					<input type="hidden" name="do[{$index}]" value="{$menu['do']}">
					<input type="hidden" name="state[{$index}]" value="{$menu['state']}">
					<input type="hidden" name="eid[{$index}]" value="{$menu['eid']}">
					<td width="100"><input type="checkbox" name="enable[{$index}]" value="1" {if $menu['dostate'] == $usdata[$menu['do'] . $menu['state']]}checked{/if}></td>
					<td>{$menu['title']}</td>
					<td><a href="{$menu['url']}" target="_blank">{$menu['url']}</a></td>
				</tr>
				{/loop}
			</table>
		</div>
	</div>
	{/if}
	{if $shuju['rule']}
	<div class="panel panel-default">
		<div class="panel-heading">规则设置权限</div>
		<div class="panel-body table-responsivee">
			<table class="table">
				<thead>
				<tr>
					<th width="100">选择</th>
					<th width="400">导航标题</th>
					<th>链接地址</th>
				</tr>
				</thead>
				{loop $shuju['rule'] $index $rule}
				<tr>
					<input type="hidden" name="title[{$index}]" value="{$rule['title']}">
					<input type="hidden" name="do[{$index}]" value="{$rule['do']}">
					<input type="hidden" name="state[{$index}]" value="{$rule['state']}">
					<input type="hidden" name="eid[{$index}]" value="{$rule['eid']}">
					<td width="100"><input type="checkbox" name="enable[{$index}]" value="1" {if $rule['dostate'] == $usdata[$rule['do'] . $rule['state']]}checked{/if}></td>
					<td>{$rule['title']}</td>
					<td><a href="{$rule['url']}" target="_blank">{$rule['url']}</a></td>
				</tr>
				{/loop}
			</table>
		</div>
	</div>
	{/if}
	{if $shuju['function']}
	<div class="panel panel-default">
		<div class="panel-heading">独立功能权限</div>
		<div class="panel-body table-responsivee">
			<table class="table">
				<thead>
				<tr>
					<th width="100">选择</th>
					<th width="400">导航标题</th>
					<th>链接地址</th>
				</tr>
				</thead>
				{loop $shuju['function'] $index $rule}
				<tr>
					<input type="hidden" name="title[{$index}]" value="{$rule['title']}">
					<input type="hidden" name="do[{$index}]" value="{$rule['do']}">
					<input type="hidden" name="state[{$index}]" value="{$rule['state']}">
					<input type="hidden" name="eid[{$index}]" value="{$rule['eid']}">
					<td width="100"><input type="checkbox" name="enable[{$index}]" value="1" {if $rule['dostate'] == $usdata[$rule['do'] . $rule['state']]}checked{/if}></td>
					<td>{$rule['title']}</td>
					<td><a href="{$rule['url']}" target="_blank">{$rule['url']}</a></td>
				</tr>
				{/loop}
			</table>
		</div>
	</div>
	{/if}
	<div class="form-group">
		<div class="col-sm-12">
			<input name="token" type="hidden" value="{$_W['token']}" />
			<input type="submit" class="btn btn-primary col-lg-1" name="submit" value="提交" />
		</div>
	</div>
</form>
{template 'common/footer'}
